package com.fjnldx.mes.domain.domainRes;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@Data
@AllArgsConstructor
@NoArgsConstructor
public class QueryResult {
    private Object data;
    private Integer code;
    private String msg;
    private String status;
    private Integer total;
    public static QueryResult success(Object data,Integer total) {
        return new QueryResult(data,1, "操作成功", "success", total);
    }
    public static QueryResult error(Object data,Integer total) {
        return new QueryResult(data,-1, "操作失败", "error", 0);
    }
}
